class Solution {
    public int strStr(String haystack, String needle) {
        if(haystack == null||needle==null)return -1 ;
         for(int i = 0 ; i < haystack.length() ; i ++){
            int j = 0 ;
            for(int h = i ; j < needle.length()&&h<haystack.length() ; j++ , h++){
              if(haystack.charAt(h) != needle.charAt(j)){
                break ;
              }
            }
            if(j == needle.length()){
                return i ;
            }
         }
         return -1 ;


    }
}